#!/bin/bash
source /etc/profile
cd /root/SmallStore/ss-register
if [ ! -f "/usr/ssjar/register-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f register-center.jar 
	cp /usr/ssjar/register-center.jar .
fi
echo "start /root/SmallStore/ss-register"
./start.sh
sleep 5

cd /root/SmallStore/ss-config
if [ ! -f "/usr/ssjar/config-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f config-center.jar 
	cp /usr/ssjar/config-center.jar  .
fi
echo "start /root/SmallStore/ss-config"
./start.sh
sleep 30

cd /root/SmallStore/ss-user
if [ ! -f "/usr/ssjar/user-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f user-center.jar
	cp /usr/ssjar/user-center.jar .
fi
echo "start /root/SmallStore/ss-user"
./start.sh

cd /root/SmallStore/ss-oauth
if [ ! -f "/usr/ssjar/oauth-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f oauth-center.jar 
	cp /usr/ssjar/oauth-center.jar .
fi
echo "start /root/SmallStore/ss-oauth"
./start.sh

cd /root/SmallStore/ss-file
if [ ! -f "/usr/ssjar/file-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f file-center.jar
	cp /usr/ssjar/file-center.jar .
fi
echo "start /root/SmallStore/ss-file"
./start.sh

cd /root/SmallStore/ss-log
if [ ! -f "/usr/ssjar/log-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f log-center.jar
	cp /usr/ssjar/log-center.jar .
fi
echo "start /root/SmallStore/ss-log"
./start.sh

cd /root/SmallStore/ss-manage-backend
if [ ! -f "/usr/ssjar/manage-backend.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f manage-backend.jar
	cp /usr/ssjar/manage-backend.jar .
fi
echo "start /root/SmallStore/ss-manage-backend"
./start.sh

cd /root/SmallStore/ss-notification
if [ ! -f "/usr/ssjar/notification-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f notification-center.jar
	cp /usr/ssjar/notification-center.jar .
fi
echo "start /root/SmallStore/notification-center"
./start.sh

cd /root/SmallStore/ss-monitor
if [ ! -f "/usr/ssjar/monitor-center.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f monitor-center.jar
	cp /usr/ssjar/monitor-center.jar  .
fi
echo "start /root/SmallStore/ss-monitor"
./start.sh
sleep 30

cd /root/SmallStore/ss-gateway
if [ ! -f "/usr/ssjar/gateway-zuul.jar" ]; then
	echo "/usr/ssjar/ not exits jar"
else
	rm -f gateway-zuul.jar 
	cp /usr/ssjar/gateway-zuul.jar  .
fi
echo "start /root/SmallStore/ss-gateway"
./start.sh